Ext.define('Admin.view.system.msg.MsgForm', {
    extend: 'Admin.ux.form.FormPanel',
    xtype: 'msg-form',
    items: [
    	{	xtype:'hiddenfield',name:'id'	},
        {
            xtype: 'textfield',
            name:'msg_title',
            fieldLabel: '消息标题',
            emptyText:'请输入标题（50字以内）',
            minLength:4,
            maxLength:50,
        },
        {
            xtype: 'radiogroup',
            fieldLabel: '紧急程度',
            columns: 8,
            items: [
                {boxLabel: '普通', name: 'level', inputValue: '0', checked: true},
                {boxLabel: '紧急', name: 'level', inputValue: '1'}
            ]
        },
	    {
			xtype: 'fieldcontainer',
			fieldLabel: '选择模版',
			layout: 'hbox',
			items:[
	    		{
	    			xtype:'combo',
	    			flex:3,
				    queryMode: 'local',
				    minChars :1,
				    emptyText:'请选择模版',
				    displayField: 'tpl_content',
				    name:'tpl_id',
				    id:'tpl_id',
				    allowBlank:false,
				    forceSelection :true,
				    valueField: 'tpl_id',
				    store : Ext.create('Ext.data.Store',{
			        	 fields: ['tpl_id','tpl_content'],
			        	 proxy: {
					        type: 'ajax',
					        url: '/template/json',
					        reader: {
					            type: 'json'
					        }
					    },
					    autoLoad:true
			        })
	    		}
	    	]
	    },
	    {
	        xtype: 'datetimefield',
	        format:'Y-m-d H:i:s',
	        fieldLabel:'选择时间',
	        todayText: '选择时间',
            hourText: '小时',
            minValue: new Date(),
            minuteText: '分钟',
	        name: 'excute_time',
	    },
	    {
			xtype: 'fieldcontainer',
			fieldLabel: '选择地点',
			layout: 'hbox',
			items:[
	    		{
	    			xtype:'combo',
	    			flex:3,
				    queryMode: 'local',
				    minChars :1,
				    emptyText:'请选择地点',
				    displayField: 'place_name',
				    name:'place_name',
				    allowBlank:false,
				    forceSelection :true,
				    valueField: 'place_name',
				    store : Ext.create('Ext.data.Store',{
			        	 fields: ['place_name','place_name'],
			        	 proxy: {
					        type: 'ajax',
					        url: '/place/json',
					        reader: {
					            type: 'json'
					        }
					    },
					    autoLoad:true
			        })
	    		}
	    	]
	    },
	    {
            xtype: 'textareafield',
            name:'msg_content',
            rows:3,
            allowBlank:true,
            fieldLabel: '自定义内容',
            maxLength:500
        },
        {
        	xtype: 'user-tree',
        }
//         {
//	        xtype: 'tagfield',
//	        fieldLabel: '发送部门',
//	        emptyText:'请选择部门',
//	        id:'dept_id',
//	        displayField: 'dept_name',
//	        valueField: 'id',
//	     	queryMode: 'local',
//	        minChars :1,
//	        remoteFilter: true,
//	        editable :true,
//	        forceSelection :true,
//         	filterPickList: true,
//	        name:'dept_id',
//	        store: Ext.create('Ext.data.Store',{
//	        	 fields: ['id','dept_name'],
//	        	 proxy: {
//			        type: 'ajax',
//			        url: '/dept/json',
//			        reader: {
//			            type: 'json'
//			        }
//			    },
//			    autoLoad:true
//	        })
//	    },
	    
    ]
});
